<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
	<script type="text/javascript" src="online.js"></script>
</head>
<body>
<script type="text/javascript">

var a = onlinenetwork({
	"time":1000,
	"url":"http://*******.com/ping.php"
})

a.onLineHandler(function(){
	console.log("连上了！")
})

a.offLineHandler(function(){
	console.log("断开网络！")
})

</script>
</body>
</html>